//
//  WYProgressCViewController.m
//  掌上还
//
//  Created by 王晓民 on 2018/3/7.
//  Copyright © 2018年 中企互联. All rights reserved.
//

#import "WYProgressCViewController.h"

@interface WYProgressCViewController ()
@property (nonatomic,strong)UIWebView *bankwebView;
@property (nonatomic,strong)NSString  *strUrl;
@end

@implementation WYProgressCViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = WYCGlobalBg;
    _bankwebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, NavHeight, ScreenWidth, ScreenHeight)];
    if ([_bankTitle isEqualToString:@"兴业银行"])
    {
        _strUrl = @"https://3g.cib.com.cn/app/00282.html";
        
    }
    else if ([_bankTitle isEqualToString:@"浦发银行"])
    {
        _strUrl = @"http://www.spdbccc.com.cn/spdb/cupd/applyProgress.do?method=index";
        
    }
    else if ([_bankTitle isEqualToString:@"平安银行"])
    {
        _strUrl = @"https://c.pingan.com/apply/mobile/modules/queryApp/index.html#queryf";
    }
    else if ([_bankTitle isEqualToString:@"招商银行"])
    {
        _strUrl = @"https://ccclub.cmbchina.com/mca/MQuery.aspx?WT.refp=%2Fmain%2Fcard-progress%24";
    }
    else if ([_bankTitle isEqualToString:@"中信银行"])
    {
        _strUrl = @"https://creditcard.ecitic.com/citiccard/wap/cardappquery/app_inq.jsp";
        
    }
    else if ([_bankTitle isEqualToString:@"光大银行"])
    {
        
        _strUrl = @"https://xyk.cebbank.com/cebmms/apply/fz/card-app-status.htm";
        
    }
    else if ([_bankTitle isEqualToString:@"交通银行"])
    {
        _strUrl = @"https://creditcardapp.bankcomm.com/member/apply/status/preinquiry.html";
        
    }
    NSLog(@"wqc=======%@",_strUrl);
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:_strUrl]];
    [self.view addSubview: _bankwebView];
    [_bankwebView loadRequest:request];
    
}
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    
    
    self.navigationController.navigationBar.hidden = YES;
    
    
    UIView * NavView = [[UIView alloc] init];
    NavView.frame = CGRectMake(0, 0, ScreenWidth, NavHeight);
    NavView.backgroundColor = WYCmainColor;
    [self.view addSubview:NavView];
    
    
    
    CALayer* bottomLineLayer = [[CALayer alloc] init];
    bottomLineLayer.frame = CGRectMake(0, NavView.bounds.size.height - 0.5, NavView.bounds.size.width, 0.5);
    bottomLineLayer.backgroundColor = WYCRGBColor(191, 191, 196).CGColor;
    [NavView.layer addSublayer:bottomLineLayer];
    
    
    
    
    
    //返回按钮
    UIButton *  fanhuibutton = [[UIButton alloc] init];
    [fanhuibutton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
    [fanhuibutton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    fanhuibutton.frame = CGRectMake(30 * px, titleY, 66 * px , 66 * px);
    [NavView addSubview:fanhuibutton];
    
    
    UILabel * NavRigsterLabel = [[UILabel alloc] init];
    NavRigsterLabel.frame = CGRectMake(0, titleY, NavView.width, 68 * px);
    NavRigsterLabel.textColor = [UIColor whiteColor];
    NavRigsterLabel.font = [UIFont boldSystemFontOfSize:BigFont];
    NavRigsterLabel.textAlignment = NSTextAlignmentCenter;
    NavRigsterLabel.text = _bankTitle;
    [NavView addSubview:NavRigsterLabel];
}
- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
